package com.lemon.core.base.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 业务枚举类
 *
 * @author pan
 * @since 2019-11-06
 */
@Getter
@AllArgsConstructor
public enum BusinessTypeEnum {

    USER("user", 100),
    MEMBER("member", 200),
    ORDER("order", 300);

    private String code;

    private Integer value;

    public static BusinessTypeEnum getValue(String code) {
        for (BusinessTypeEnum value : values()) {
            if (value.getCode().equals(code)) {
                return value;
            }
        }
        return null;
    }
}
